package com.demo2do.fms.entity.business.shipment;

import org.apache.commons.lang3.StringUtils;

import com.demo2do.core.utils.Alias;

/**
 * 调度方式
 * 
 * @author Ysy
 *
 */
@Alias("transType")
public enum TransType {
    
	TransType_0 ("空车调度"),
    
	TransType_1 ("一次运输"),
    
	TransType_2 ("二次运输"),
    
	TransType_3 ("返程"),
    
	TransType_4 ("上海市内短驳"),
    
	TransType_5 ("上海到火车站"),
    
	TransType_6 ("上海到码头"),
    
	TransType_7 ("市外短驳"),
    
	TransType_8 ("外地到火车站"),
    
	TransType_9 ("外地到码头"),
    
	TransType_10 ("修理车"),
    
	TransType_11 ("非商品车"),
    
	TransType_12 ("社会运输"),

	TransType_13 ("对流");
    
    private String description;
    
    /**
     * @param description
     */
    private TransType(String description) {
        this.description = description;
    }
    
    /**
     * @param ordinal
     * @return
     */
    public static TransType ordinalOf(String ordinal) {
    	
    	for (TransType transType : TransType.values()) {
    		String transOrdinal = transType.ordinal() + "";
			if (StringUtils.equals(ordinal.trim(), transOrdinal)) {
				return transType;
			}
		}
    	
    	return null;
    	
    }
    
    /**
     * @return
     */
    public int getOrdinal() {
    	return this.ordinal();
    }

    /**
     * @return the description
     */
    public String getDescription() {
        return description;
    }
    
    /**
     * 
     * @return
     */
    public String ordinalString(){
        return String.valueOf(this.ordinal());
    }
}
